FROM debian:buster-slim
RUN apt-get update && \
    apt-get -y install apt apt-transport-https ca-certificates && \
    echo '\
        deb https://deb.debian.org/debian buster main \
        deb https://deb.debian.org/debian-security buster/updates main \
        deb https://deb.debian.org/debian buster-updates main \
    ' > /etc/apt/sources.list && \
    apt-get -y install ruby ruby-dev gcc g++ make && \
    gem install bundler && \
    mkdir -p /var/cucumber

WORKDIR /var/cucumber
COPY Gemfile* ./
RUN bundle install
COPY features/ ./features/
ENTRYPOINT ["bundle", "exec"]
CMD ["sh", "-c", "exec cucumber --fail-fast ${CUCUMBER_ARGS}"]
